package com.hgy.carsb.controller;


import com.hgy.carsb.entity.IndicatorDetail;
import com.hgy.carsb.service.InfoService;
import com.hgy.carsb.service.MainIndicatorService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.ArrayList;
import java.util.List;

@RestController
public class MainIndicatorController {

    @Autowired
    private InfoService infoService;

    @Autowired
    private MainIndicatorService mainIndicatorService;

    private int year = 2020;
    private int month = 4;

    @GetMapping("/mainindicator")
    public List<IndicatorDetail> getIndicator(){
        List<IndicatorDetail> list = new ArrayList<>();
        list.add(mainIndicatorService.getOverlayDetail(year, month, "product", "FAW"));
        list.add(mainIndicatorService.getOverlayDetail(year, month, "product", "FAW"));
        list.add(mainIndicatorService.getOverlayDetail(year, month, "sale", "FAW"));
        list.add(mainIndicatorService.getSignalDetail(year, month, "store", "FAW"));
        list.add(mainIndicatorService.getSignalDetail(year, month, "store", "FAW"));
        list.add(mainIndicatorService.getSignalDetail(year, month, "asset", "FAW"));
        list.add(mainIndicatorService.getSignalDetail(year, month, "right", "FAW"));
        list.add(mainIndicatorService.getSignalDetail(year, month, "right", "FAW"));
        list.add(mainIndicatorService.getSignalDetail(year, month, "income", "FAW"));
        list.add(mainIndicatorService.getSignalDetail(year, month, "interest", "FAW"));
        list.add(mainIndicatorService.getSignalDetail(year, month, "interest", "FAW"));
        list.add(mainIndicatorService.getRatioDetail(year, month, "dept", "asset", "FAW"));
        list.add(mainIndicatorService.getOverlayDetail(year, month, "wkcapital", "FAW"));
        list.add(mainIndicatorService.getRatioDetail(year, month, "interest", "income", "FAW"));
        return list;
    }

}
